package com.huawei.hwid.update.a;

import android.os.Handler;
import android.os.Looper;
import com.huawei.hwid.update.a.a.a;
import com.huawei.hwid.update.a.a.b;
import java.io.File;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

public class c implements a {
    private static final Executor a = Executors.newSingleThreadExecutor();
    private final a b;

    public c(a aVar) {
        com.huawei.hwid.f.a.a(aVar, "update must not be null.");
        this.b = aVar;
    }

    private static b b(final b bVar) {
        return new b() {
            public void a(final int i, final com.huawei.hwid.update.a.a.c cVar) {
                new Handler(Looper.getMainLooper()).post(new Runnable(this) {
                    final /* synthetic */ AnonymousClass1 c;

                    public void run() {
                        bVar.a(i, cVar);
                    }
                });
            }

            public void a(int i, int i2, int i3, File file) {
                final int i4 = i;
                final int i5 = i2;
                final int i6 = i3;
                final File file2 = file;
                new Handler(Looper.getMainLooper()).post(new Runnable(this) {
                    final /* synthetic */ AnonymousClass1 e;

                    public void run() {
                        bVar.a(i4, i5, i6, file2);
                    }
                });
            }
        };
    }

    public void a() {
        this.b.a();
    }

    public void a(final b bVar, final com.huawei.hwid.update.a.a.c cVar) {
        a.execute(new Runnable(this) {
            final /* synthetic */ c c;

            public void run() {
                this.c.b.a(c.b(bVar), cVar);
            }
        });
    }
}
